package com.ms.education.acl.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ms.education.acl.entity.Role;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ms
 * @since 2023-02-18
 */
public interface RoleService extends IService<Role> {

    /**
     * 获取角色分页列表
     * @param current
     * @param limit
     * @param role
     * @return
     */
    Page<Role> pageRole(long current, long limit, Role role);

    //获取用户角色和权限
    Map<String, Object> getRoleAndPermission(Integer userId);

    /**
     * 获取用户角色id
     * @param userId
     * @return
     */
    List<Integer> getUserRole(Integer userId);

    /**
     * 为用户赋予角色
     * @param userId
     * @param roleIds
     */
    void endowedUserRole(Integer userId, Integer[] roleIds);
}
